<#assign class = pojo.getDeclarationName()>
    public static abstract class BaseInfo extends ModelInfo {
    	public String getName() {
    		return "${class}";
    	}
    	public Property[] getProperties() {
    	    return PROPERTIES;
    	}
    	public Property[] getKeyProperties() {
    	    return KEY_PROPERTIES;
    	}
    	public String validate(Object model) {
    	    String message = super.validate(model);
    	    if( message != null )
    	        return message;
    	    return validate((${class})model);
    	}
    	protected abstract String validate(${class} model);
<#foreach property in pojo.getAllPropertiesIterator()>
  <#if pojo.getMetaAttribAsBool(property, "gen-property", true)>
     <#assign     name = pojo.getPropertyName(property) 
		 type = pojo.getJavaTypeName(property, jdk5)>
		 
        public static class _${name} extends ${type}Property {
            public String getName() {
                return "${name}";
            }
    <#if type == "String">
      <#foreach column in property.getColumnIterator()>
            public int getLength() {
                return ${column.getLength()?c};
            }
        <#break>
      </#foreach>
    <#elseif type == "Integer" || type == "BigDecimal">
      <#foreach column in property.getColumnIterator()>
            public int getScale() {
                return ${column.getPrecision()?c};
            }
            public int getPrecision() {
                return ${column.getScale()?c};
            }
        <#break>
      </#foreach>
    </#if>
            public ${type} _get(Object model) {
                return ((${class})model).${pojo.getGetterSignature(property)}(); 
            }
            public void _set(Object model, ${type} value) {
                ((${class})model).set${name}(value);
            }
        }
        public static final ${type}Property ${name} = new _${name}();
  </#if>
</#foreach>
    
    	
    	private static final Property[] KEY_PROPERTIES = new Property[] {
<#foreach property in pojo.getAllPropertiesIterator()>
  <#if pojo.getMetaAttribAsBool(property, "gen-property", true)>
  	<#if ! property.isOptional()>
            ${pojo.getPropertyName(property)},
  	</#if>
  </#if>
</#foreach>
        };
    	private static final Property[] PROPERTIES = new Property[] {
<#foreach property in pojo.getAllPropertiesIterator()>
  <#if pojo.getMetaAttribAsBool(property, "gen-property", true)>
  	<#if property.isOptional()>
            ${pojo.getPropertyName(property)},
  	</#if>
  </#if>
</#foreach>
        };
    }
    
    public static final BaseInfo INFO = new ${class}Info();

    public ModelInfo getModelInfo() {
    	return INFO;
    }
    